// Aufgabe_12_5_Zeit

var a, b, c, d, e, f, g, h;

function preload() {
  a = loadImage("schwarz.png");
  b = loadImage("weiss.png");
  c = loadImage("pink.png");
  d = loadImage("93.png");
  e = loadImage("blaurosa.png");
  f = loadImage("face.png");
  g = loadImage("laufen.png");
  h = loadImage("weissbraun.png");
}

function setup() {
 	var xy = createCanvas(900, 500);
  xy.position(200, 100);
  background(0);

  // Tasten
  taste = createButton("schwarz");
  taste.style("font-size", "25px");
  taste.position(200, 620);
  taste.mousePressed(A);

  taste = createButton("weiß");
  taste.style("font-size", "25px");
  taste.position(330, 620);
  taste.mousePressed(B);

  taste = createButton("pink");
  taste.style("font-size", "25px");
  taste.position(430, 620);
  taste.mousePressed(C);

  taste = createButton("93");
  taste.style("font-size", "25px");
  taste.position(520, 620);
  taste.mousePressed(D);

  taste = createButton("blaurosa");
  taste.style("font-size", "25px");
  taste.position(590, 620);
  taste.mousePressed(E);

  taste = createButton("face");
  taste.style("font-size", "25px");
  taste.position(735, 620);
  taste.mousePressed(F);

  taste = createButton("laufen");
  taste.style("font-size", "25px");
  taste.position(830, 620);
  taste.mousePressed(G);

  taste = createButton("weissbraun");
  taste.style("font-size", "25px");
  taste.position(950, 620);
  taste.mousePressed(H);
}

function draw() {
	noStroke();
  textSize(30);
}

// Funktionen
function A() {
image(a, random(-200, 900), random(-100, 200), 100, 100);
fill(255);
text("Zeit ist Geld!", random(-200, 900), random(300, 500));
}
function B() {
image(b, random(-200, 900), random(-100, 200), 100, 100);
fill(255);
}
function C() {
image(c, random(-200, 900), random(-100, 200), 100, 100);
fill(255, 100, 255);
text("Schnell! Schnell!", random(-200, 900), random(300, 500));
}

function D() {
image(d, random(-200, 900), random(-100, 200), 100, 100);
fill(0, 230, 0);
text("Tempo!", random(-200, 900), random(300, 500));
}
function E() {
image(e, random(-200, 900), random(-100, 200), 100, 100);
fill(255);
}
function F() {
image(f, random(-200, 900), random(-100, 200), 100, 100);
fill(255, 0, 0);
text("Eile! Eile!", random(-200, 900), random(300, 500));
}

function G() {
image(g, random(-200, 900), random(-100, 200), 100, 100);
fill(0, 230, 255);
text("Lauf!", random(-200, 900), random(300, 500));
}
function H() {
image(h, random(-200, 900), random(-100, 200), 100, 100);
fill(255);
}
